package com.tanghy.web.controller;

import com.knappsack.swagger4springweb.controller.ApiDocumentationController;
import com.wordnik.swagger.model.ApiInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* This is an example of how you might extend the ApiDocumentationController in order to set your own RequestMapping
* (instead of the default "/api") among other possibilities.  Going this route, you do not necessarily have to define
* the controller in your servlet context.
*/
@Controller
@RequestMapping(value = "/documentation")
public class DocumentationController extends ApiDocumentationController {

    public DocumentationController() {

        setBaseControllerPackage("com.tanghy.web.controller.impl");
        setBaseModelPackage("com.tanghy.model");
        setApiVersion("v1.0");

        ApiInfo apiInfo = new ApiInfo(
                "影像管理后台服务",
                "这是一个神奇的网站！",
                "http://localhost:8080/terms",
                "http://localhost:8080/contact",
                "MIT",
                "http://opensource.org/licenses/MIT");

        setApiInfo(apiInfo);
    }

    @RequestMapping(value = "/doc", method = RequestMethod.GET)
    public String documentation() {
        return "documentation";
    }
}
